﻿@using eBusiness.App_DAL
@model eBusiness.Models.News
@{
    ViewBag.Title = "Details";
    Layout = "../Shared/_Layout.cshtml";
}
<h2>
    Details</h2>
<fieldset>
    <legend>News</legend>
    <table class="dashboardTable">
        <tr>
            <td style="width: 120px; padding: 10px;">
                <img src="@Model.ThumbImage" alt="image" style="width: 120px;" />
            </td>
            <td>
                <table class="dashboardTable">
                    <tr>
                        <td colspan="2">
                            <h2>@Html.DisplayFor(model => model.Title)</h2>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            created on <span>@Html.DisplayFor(model => model.CreatedDate)</span> by <span>
                                @{
                                    if (!string.IsNullOrEmpty(Model.CreatedBy.ToString()))
                                    {
                                        var usr = Membership.GetUser(Model.CreatedBy).UserName;
                                    @usr
                                    }
                                }
                            </span>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <b>Summary</b>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            @{
                                var summary = Server.HtmlDecode(Model.Details).GetLeft(300, true);
                                <p>
                                    @summary
                                </p>
                            }
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <b>Details</b>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <p>@Html.Raw(Model.Details)
                            </p>
                            @*@{
                                var details = Server.HtmlDecode(Model.Details);
                                <pre>
                                    @Model.Details
                                </pre>
                            }*@
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</fieldset>
<p>
    @Html.ActionLink("Edit", "Edit", new { id = Model.ID }) |
    @Html.ActionLink("Back to List", "Index")
</p>
